﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main.aspx.cs" Inherits="SaleSystem.main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server">
    </ext:PageManager>
    <ext:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server">
        <Regions>
        <ext:Region ID="Region1" Margins="0 0 0 0" Height="62px" ShowBorder="false" ShowHeader="false"
                Position="Top" Layout="Fit" runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
                        <Items>
                            <ext:ToolbarText ID="tb_UserName" Text="&nbsp;欢迎您：登陆系统！" runat="server">
                            </ext:ToolbarText> 
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                            </ext:ToolbarFill>     
                           <%-- <ext:DropDownList ID="ddlTheme" Width="100px" AutoPostBack="true" OnSelectedIndexChanged="ddlTheme_SelectedIndexChanged"
                                runat="server">
                                <ext:ListItem Text="Blue" Selected="true" Value="blue" />
                                <ext:ListItem Text="Gray" Value="gray" />
                                <ext:ListItem Text="Access" Value="access" />
                            </ext:DropDownList>--%>
                            <ext:ToolbarText ID="ToolbarText2" Text="&nbsp;" runat="server">
                            </ext:ToolbarText>
                            <ext:Button runat="server" ID="bnWorkFlow" ToolTip="日程" Icon="Date" OnClientClick="addTab('dynamic_added_tab20','./Other/frm_WorkPlanList.aspx','其他工具 -> 日程安排');return false;"></ext:Button>                                   <ext:Button runat="server" ID="Button1" ToolTip="利润分析" Icon="ChartLine" OnClientClick="addTab('dynamic_added_tab23','./Analysis/frm_ProfitList.aspx','统计分析 -> 利润分析');return false;"></ext:Button>   
                               <ext:Button runat="server" ID="bnStyle" Icon="Paint" ToolTip="风格切换" ></ext:Button>   
                            <ext:Button ID="Button2" runat="server" Icon="Calendar" ToolTip="万年历" EnablePostBack="false"
                                OnClientClick="addTab('calendar', './Other/wannianli.htm', '万年历')">
                            </ext:Button>
                            <ext:Button ID="Button3" runat="server" Icon="Calculator" ToolTip="科学计算器" EnablePostBack="false"
                                OnClientClick="addTab('jisuanqi', './Other/jisuanqi.htm', '科学计算器')"></ext:Button>
                               <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                            </ext:ToolbarSeparator>
                            <ext:Button runat="server" ID="bnExit" Text="退出" OnClick="bnExitClick"></ext:Button>           
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
                <Items>
                    <ext:ContentPanel ShowBorder="false" ShowHeader="false" BodyStyle="background-color:#1C3E7E;"
                        ID="ContentPanel1" runat="server">
                        <table cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td>
                                <div class="header">
                                <a href="#" style="color:#fff;"><asp:Label ID="lbSystemInfo" runat="server"></asp:Label></a>
                                </div>
                            </td>
                            <td style="text-align:right;color:#ccc;"><a href="mailto:CopyRight WUJING0209@163.com" style="color:#ccc;">CopyRight WUJING Mail: WUJING0209@163.com&nbsp;</a> </td>
                        </tr>
                        </table>
                    </ext:ContentPanel>
                </Items>
            </ext:Region>
            <ext:Region ID="Region2" Split="true" Width="200px" Margins="0 0 0 0" ShowHeader="true"
                Title="系统菜单" EnableCollapse="true" Layout="Fit" Position="Left" runat="server">
                <Items>
                     <ext:Tree runat="server" ID="tv_Menu" EnableBackgroundColor="true" ShowHeader="false" >
                     </ext:Tree>
                </Items>
            </ext:Region>
            <ext:Region ID="Region3" ShowHeader="false" EnableIFrame="true" Layout="Fit" IFrameName="main" Margins="0 0 0 0" Position="Center" runat="server">
                <Items>
                <ext:TabStrip ID="mainTabStrip"  EnableTabCloseMenu="true" ShowBorder="false" runat="server">
                        <Tabs>
                            <ext:Tab ID="tab_Home" Title="Home" Layout="Fit" Icon="House" runat="server" EnableIFrame="true"  IFrameUrl="about:blank" >
                                     
                            </ext:Tab>
                        </Tabs>
                    </ext:TabStrip>
                </Items>
            </ext:Region>
        </Regions>
    </ext:RegionPanel>
    <ext:Window runat="server" ID="WorkForm" IsModal="false" EnableDrag="false"  EnableClose="true" Height="172px" Width="332px" Hidden="true"  Layout="Absolute" IFrameUrl="./Other/frm_WorkPlanDetailList.aspx" EnableIFrame="true"  Icon="Email" >
    </ext:Window> 
    <ext:Window runat="server" ID="win_Content" IsModal="true" EnableDrag="true"  EnableClose="true" Height="152px" Width="332px" Hidden="true"  Layout="Absolute" IFrameUrl="" EnableIFrame="true"  >
    
    </ext:Window> 
    </form>
               <script type="text/javascript">
                      function onReady() {
            var treeMenu = Ext.getCmp('<%= tv_Menu.ClientID %>');
            function addExampleTab(node) {
                var href = node.attributes.href;                  
                             
         

                var refreshButton = new Ext.Button({
                    text: 'Refresh',
                    type: "button",
                    cls: "x-btn-text-icon",
                    icon: '<%= IconHelper.GetIconUrl(Icon.Reload) %>',
                    listeners: {
                        click: function(button, e) {
                            // Note: button.ownerCt is toolbar, button.ownerCt.ownerCt is current active tab.
                            Ext.DomQuery.selectNode('iframe', button.ownerCt.ownerCt.getEl().dom).contentWindow.location.replace(href);
                            e.stopEvent();
                        }
                    }
                });
                
                // Add a dynamic tab (With toolbar).
                var mainTabStrip = Ext.getCmp('<%= mainTabStrip.ClientID %>');
                var tabID = 'dynamic_added_tab' + node.id.replace('__', '-');
                
                mainTabStrip.addTab({
                    'id': tabID,
                    'url': href,
                    'title': node.parentNode.text + ' -> ' + node.text,
                    'closable': true,
                    'bodyStyle': 'padding:0px;'                   
                });               
                 
            }

            // Click the tree node.
            treeMenu.on('click', function(node, event) {
                
                if (node.isLeaf()) {           
                    var href = node.attributes.href;
                    // Modify the location of current url.
                    window.location.href = '#' + href;

                    addExampleTab(node);

                    // Don't response to this tree node's default behavior. 
                    event.stopEvent(); 
                }
            });


            (function pageFirstLoad() {
                var currentHash = window.location.hash.substr(1);
                var level1Nodes = treeMenu.getRootNode().childNodes;
                for (var i = 0; i < level1Nodes.length; i++) {
                    var level2Nodes = level1Nodes[i].childNodes;
                    for (var j = 0; j < level2Nodes.length; j++) {
                        var currentNode = level2Nodes[j];
                        if (currentNode.attributes.href === currentHash) {
                            level1Nodes[i].expand();
                            // We must retrieve this node again, because currentNode doesn't has parentNode property.
                            var foundNode = treeMenu.getNodeById(currentNode.id);
                            foundNode.select();
                            addExampleTab(foundNode);
                            return;
                        }
                    }
                }
            })();

        }
        function GetPosition() {
            var wform = Ext.getCmp('<%= WorkForm.ClientID %>');
            wform.x = Ext.getBody().getWidth() - 332;
            wform.y = Ext.getBody().getHeight() - 172;
            wform.show();
        }
        function addTab(id, url, title) {
            // Add a dynamic tab.
            var mainTabStrip = Ext.getCmp('<%= mainTabStrip.ClientID %>');
            var tabID = id;
            
            mainTabStrip.addTab(tabID, url, title, true);
         
        }
        
         </script>
</body>
</html>
